#!/bin/bash

# 截图脚本
# 用于手动截取当前屏幕

DISPLAY=${DISPLAY:-:99}
SCREENSHOT_DIR="/app/screenshots"
TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
FILENAME="manual_screenshot_${TIMESTAMP}.png"

mkdir -p "$SCREENSHOT_DIR"

echo "正在截图..."
echo "显示器: $DISPLAY"
echo "保存路径: $SCREENSHOT_DIR/$FILENAME"

# 使用scrot截图
scrot -z "$SCREENSHOT_DIR/$FILENAME"

if [ $? -eq 0 ]; then
    echo "截图成功: $FILENAME"
else
    echo "截图失败"
    exit 1
fi 